package com.project.class4_11.model.watch;

public class Test {
    public static void main(String[] args) {
        //创建主题
        Factory f = new Factory();
        Proxy1 p1 = new Proxy1();
        Proxy2 p2 = new Proxy2();
        //添加观察者
        f.addWatch(p1);
        f.addWatch(p2);

        //设置厂价
        f.setPrice(100);
        System.out.println(p1.getPrice() + "   "+p2.getPrice());
        f.setPrice(120);
        System.out.println(p1.getPrice()+"   "+p2.getPrice());
    }
}
